package com.yeyks.common.em.accountinfo;

/**
 * @author fuchangshuai
 * @date 2019/09/02 17:53
 */
public enum AccountInfoTypeEnum {
    Administrator(1, "总公司"),
    ProvinceManager(2, "省代理"),
    CityAgent(3, "市代理"),
    CityManager(4, "城市运营商"),
    HotelManager(5, "酒店"),
    OperateMerchant(10, "运营商"),
    ServiceMerchant(11, "服务商"),
    VipCardMerchant(12, "卡商"),
    MiniOperateMerchant(20, "小v运营商"),
    MiniServiceMerchant(21, "小v服务商"),
    MiniVipCardMerchant(22, "小v卡商");

    int value;
    String desc;

    AccountInfoTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(int value) {
        for (AccountInfoTypeEnum accountInfoTypeEnum : values()) {
            if (accountInfoTypeEnum.value() == value) {
                return accountInfoTypeEnum.desc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        for (AccountInfoTypeEnum accountInfoTypeEnum : values()) {
            if (accountInfoTypeEnum.desc().equals(desc)) {
                return accountInfoTypeEnum.value();
            }
        }
        return null;
    }
}
